<template>
  <div>
  <div style="width: 400px;margin: auto;border: 2px solid black;height: 300px">

    用户名：
    <el-input v-model="userObj.userName" placeholder="请输入用户名" class="logininput"/>
    <br>
    密码：
    <el-input v-model="userObj.pwd" type="password" placeholder="请输入密码" class="logininput"/>
    <br>
    <el-button type="primary" @click="land()">
      <el-icon><Coffee /></el-icon>  登陆
    </el-button>
  </div>
  </div>
</template>

<script>
import axios from 'axios';

export default {
  data() {
    return {
      userObj: {},
    }
  },
  methods: {
    land() {
      axios.get("/project/user/login", {params: this.userObj}).then(resp => {
        if (resp.data === "ok") {
          this.$router.push("/index");
        }
      })
    },
  }
}
</script>

<style scoped>
.logininput{
  width: 200px;

}
</style>